import React, {useState} from 'react';
import {Button, Table, Tag} from 'antd';

function RefundList(props) {

  const [columns, setColumns] = useState([
    {
      title: '产品',
      key: 'goods_logo',
      render: (text, record) => {
        // review === 1 未审核
        return <div className='BeforeOperatedAction'>
          <img style={{width: '70px'}} src={text.goods_logo}/>
        </div>;
      }
    }, {
      title: '产品名称',
      dataIndex: 'goods_title',
      key: 'goods_title'
    }, {
      title: '数量',
      dataIndex: 'refund_num',
      key: 'refund_num'
    },
    {
      title: '单价',
      dataIndex: 'selling_price',
      key: 'selling_price'
    },
    {
      title: '订单号',
      dataIndex: 'order_no',
      key: 'order_no'
    }, {
      title: '供应商',
      dataIndex: 'vendor_name',
      key: 'vendor_name'
    }, {
      title: '创建时间',
      dataIndex: 'create_at',
      key: 'create_at'
    }, {
      title: '操作',
      key: 'action',
      render: (text, record) => {
        return <div className='BeforeOperatedAction'>
          {/*receipt = 0 显示 确认退款  1隐藏*/}
          {
            text.refund == 0 && <Button
              size={'small'}
              type={'default'}
              onClick={() => props.tempConfirmRefund(text.refund_no)}
            >确认退款</Button>
          }
        </div>;
      }
    }

  ]);

  return (
    <div className={'SupplierOrderList'}>
      <Table dataSource={props.refundList} columns={columns} pagination={false}/>
    </div>
  );
}

export default RefundList;
